<template>
<div>
  <div style="margin:10px 0 0 10px;">
  <el-button type="primary" @click="saveData">保存</el-button> 
  </div>
<el-form    ref="dataForm" size="mini" :model="temp" label-width="150px" >
  <el-form-item class="form-item-full" label="A/C Name 户名" prop="title" >
    <el-input v-model="temp.a_c_name" style="width: 280px;" ></el-input>
  </el-form-item>
  <el-form-item label="A/C No. 银行账号" prop="title" class="form-item-full">
    <el-input v-model="temp.a_c_no" style="width: 280px;" ></el-input>
  </el-form-item>
  <el-form-item label="Bank 开户行" prop="title" class="form-item-full">
    <el-input v-model="temp.bank_addr" style="width: 280px;" ></el-input>
  </el-form-item>
</el-form>

</div>
</template>

<script>
import API from '@/utils/backend_api'
export default {
  name: 'company_account',
  data() {
    return {
      temp: {
        a_c_name: '',
        a_c_no: '',
        bank_addr: ''
      }
    }
  },
  created() {
    API.sys.get_account().then(response => {
      if (response.data) {
        this.temp = response.data
      }
    })
  },
  methods: {
    saveData() {
      API.sys.update_account(this.temp).then(response => {
        this.$notify({
          title: '成功',
          message: '保存成功',
          type: 'success',
          duration: 2000
        })
      })
    }
  }
}
</script>

<style>
  .form-item-full {
    width: 100%
  }
</style>